VERSION 5.00
Begin VB.Form ReprintVCTForm 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   0  'None
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Clear_Button 
      Caption         =   "Clear"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   5
      Top             =   6360
      Width           =   1935
   End
   Begin VB.CommandButton Next_Button 
      Caption         =   "Lookup"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   4
      Top             =   5160
      Width           =   1935
   End
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   7560
      Width           =   1935
   End
   Begin VCT.TouchKeyPad TouchKeyPad1 
      Height          =   4035
      Left            =   2340
      TabIndex        =   0
      Top             =   3600
      Width           =   3555
      _ExtentX        =   6271
      _ExtentY        =   7117
   End
   Begin VB.Label Menu2_Label 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Client Code:"
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2400
      TabIndex        =   2
      Top             =   1980
      Width           =   2235
   End
   Begin VB.Label ClientCode_Data 
      BackColor       =   &H00C0FFFF&
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Abadi MT Condensed Light"
         Size            =   20.25
         Charset         =   0
         Weight          =   300
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2880
      TabIndex        =   1
      Top             =   2520
      Width           =   2655
   End
   Begin VB.Shape ClientCodeBox 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   1  'Opaque
      BorderWidth     =   2
      FillColor       =   &H00FFFFFF&
      Height          =   735
      Left            =   2760
      Shape           =   4  'Rounded Rectangle
      Top             =   2460
      Width           =   3015
   End
End
Attribute VB_Name = "ReprintVCTForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Cancel_Button_Click()
   VCTStageForm.Show
   Unload Me
End Sub

Private Sub Clear_Button_Click()
   Clear_Button.Enabled = False
   Next_Button.Enabled = False
   ClientCode_Data.Caption = ""
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
   Dim DecodedString As String
   
   If KeyAscii = 36 Then
      DecodedString = Hex2Dec(Pat_Barcode_Str)
      Pat_Barcode_Str = ""
      SITE = Mid(DecodedString, 1, 2)
      OutreachVar = Mid(DecodedString, 3, 2)
      CLIENTCO = Mid(DecodedString, 5, 7)
      ClientCode_Data.Caption = Val(CLIENTCO)
      Next_Button.Enabled = True
      Clear_Button.Enabled = True
   Else
      Pat_Barcode_Str = Pat_Barcode_Str & Chr(KeyAscii)
   End If
End Sub

Private Sub Form_Load()
   Next_Button.Enabled = False
   ClientCode_Data.Caption = ""
End Sub

Private Sub Next_Button_Click()

   Dim Found As Boolean
   
   CLIENTCO = ClientCode_Data.Caption
   VISITID = 0
   
   'Check if the client code is in the database and if the post test counseling was completed
'   CnUser.Open ConnectString
'   Cmd.CommandText = "SELECT SEX, VDATE, VISITID, VISITTYP" _
'                  & " FROM   client" _
'                  & " WHERE  CLNTCODE = " & CLIENTCO _
'                  & " AND (VISITTYP = '1' OR VISITTYP = '2')" _
'                  & " AND TIMEPRE IS NOT NULL" _
'                  & " ORDER BY VISITID DESC"
'   Cmd.CommandType = adCmdText
'   Cmd.ActiveConnection = CnUser
'   RsUser.Open Cmd, , adOpenStatic
'   If RsUser.EOF = False Then
'      Found = True
'      SEX = RsUser(0)
'      VDATE = RsUser(1)
'      VISITID = RsUser(2)
'      VISITTYP = RsUser(3)
'   Else
'      Found = False
'   End If
'   RsUser.Close
'   CnUser.Close
'
'   If Found = True Then
'      ReprintDetailForm.Show
'      Unload Me
'   Else
'      Global_Error_Msg = "A record matching the client code " & CLIENTCO & " can not be found in the database."
'      Global_Error_Form.Show 1
'      VCTStageForm.Show
'      Unload Me
'   End If

   VCTSummaryForm.Show
   Unload Me
      
End Sub

Private Sub TouchKeyPad1_NumPressed()
   Next_Button.Enabled = True
   Clear_Button.Enabled = True
   ClientCode_Data.Caption = ClientCode_Data.Caption & TouchKeyPad1.KeyNum
End Sub
